from flask_restplus import Resource, Namespace, fields, marshal, reqparse
from common.request_parser import get_parser as base_get_parser

# ---------- create parser ----------
create_parser = reqparse.RequestParser()
create_parser.add_argument('date', type=str, help='单据日期')
create_parser.add_argument('draft_status', type=str, help='草稿状态')
create_parser.add_argument('notes', type=str, help='备注')
create_parser.add_argument('order_skus_json', action='append')

purchase_sale_create_parser = create_parser.copy()
purchase_sale_create_parser.add_argument('customer_id', type=str, help='供应商')
purchase_sale_create_parser.add_argument('warehouse_id', type=str, help='仓库')
purchase_sale_create_parser.add_argument('account_id', type=str, help='结算账户')
purchase_sale_create_parser.add_argument('second_account_id', type=str, help='第二结算账户')
purchase_sale_create_parser.add_argument('tracking_number', type=str, help='快递单号')
purchase_sale_create_parser.add_argument('is_make', type=str, help='是否开票')
purchase_sale_create_parser.add_argument('bill_info', type=str, help='开票信息')

purchase_create_parser = purchase_sale_create_parser.copy()
sale_create_parser = purchase_sale_create_parser.copy()

check_create_parser = create_parser.copy()
check_create_parser.add_argument('warehouse_id', type=str, help='仓库')

# ---------- get parser ----------
get_parser = base_get_parser.copy()

# def add_basic_parser(parser):
#     parser.add_argument('id', type=str, help='编号')
#     parser.add_argument('notes', type=str, help='备注')
#     parser.add_argument('is_active', type=str, help='启用状态')
#     parser.add_argument('create_datetime', type=str, help='创建时间')
#     parser.add_argument('update_datetime', type=str, help='更新时间')